package base

type EntityInterface interface {
	Id() int64
	Status() int8
}

type Entity struct {
	id     int64
	status int8 // 0: not save store 1: save store
}

const (
	NotSaveStore = 0
	SaveStore    = 1
)

func NewEntity(id int64) Entity {
	// not save store
	if id == NotSaveStore {
		return Entity{id: id, status: NotSaveStore}
	}
	return Entity{id: id, status: SaveStore}
}

func (t *Entity) Id() int64 {
	return t.id
}

func (t *Entity) IdInt() int {
	return int(t.id)
}

func (t *Entity) IdInt64() int64 {
	return t.id
}
